/*
 * Copyright (c) 2007 The Trustees of Indiana University. All rights reserved.
 * IU CSCI B534 Distributed Systems 2007-02-01 http://www.cs.indiana.edu/classes/b534
 */

package edu.indiana.cs.b534.torrent.struct;

import edu.indiana.cs.b534.torrent.TList;
import edu.indiana.cs.b534.torrent.TStruct;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

public class TListImpl<T extends TStruct> implements TList<T> {

    protected List<T> list;

    public static TList deserialize(InputStream inStream) throws IOException {
	// deserialize the list from the stream and return a new instance of TListImpl
	return null;
    }

    public static TList newInstance() {
        return new TListImpl();
    }

    protected TListImpl(){
        list = new ArrayList<T>();
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list_) {
        list = list_;
    }

    public OutputStream serialize(OutputStream outStream) throws IOException {
	// TODO
	return null;
    }

    public String toString(){
	// TODO: useful for debugging
	return null;
    }
}
